package bl;

import java.util.ArrayList;

import db.DataShowOperate;
import db.DatabaseFactory;
import db.InitDatabase;
import dbservice.DatabaseService;
import dbservice.FactoryService;

import po.PlanItemPO;
import po.StrategyPO;
import po.TeachingRecordPO;
import blservice.TeachingRecordBLService;

public class TeachingRecordBLImpl extends InitDatabase implements TeachingRecordBLService{

	
	private FactoryService dbService = DatabaseFactory.getDatabase();  

	@Override
	public ArrayList<TeachingRecordPO> getTeachingRecordByCourseID(int courseID) {
		// TODO Auto-generated method stub
		DataShowOperate dataShowOperate = dbService.getShowOperate();
//		ArrayList<TeachingRecordPO> teachingRecordPOsList = new ArrayList<>();
		
		return dataShowOperate.getTeachingRecordPOs(courseID);
	}

	@Override
	public int addTeachingRecord(int CourseID, int TeacherID) {
		// TODO Auto-generated method stub
		DatabaseService<TeachingRecordPO> teachingRecordDB = dbService.getTeachingRecordDB() ;
		
		TeachingRecordPO teachingRecordPO = new TeachingRecordPO(CourseID,TeacherID);
		
		return teachingRecordDB.insert(teachingRecordPO);
	}

}
